package com.redhat.auth.log.core.domain;

import java.util.Date;
import java.util.HashMap;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.apache.commons.lang.builder.HashCodeBuilder;

import com.dayatang.domain.BaseEntity;

@Entity
@Table(name="LOG_BIZ_INFO")
public class BizLogInfo extends BaseEntity{

	private static final long serialVersionUID = -3117942686060699962L;
	
	/**
	 * KEY值，此值能够 唯一标志一个业务实体
	
	@Column(name="ENTITY_ID",length=400)
	private String entityId;
	 */
	
	/**
	 * 操作用户
	 */
	@Column(name="OPERATOR",length=50)
	private String operator;
	
	/**
	 * 业务类型
	 */
	@Column(name="BIZ_TYPE",length=100)
	private String bizType;
	
	/**
	 * 业务操作
	 */
	@Column(name="BIZ_OPERATOION",length=100)
	private String bizOperation;
	
	/**
	 * 当前系统名
	 */
	@Column(name="System",length=20)
	private String system;
	
	/**
	 * 当前服务器IP
	 */
	@Column(name="SERVER_IP",length=20)
	private String serverIp;
	
	/**
	 * 客户IP
	 */
	@Column(name="CLIENT_IP",length=20)
	private String clientIp;
	
	/**
	 * 业务发生时间
	 */
	@Column(name="BIZ_DATE")
	@Temporal(TemporalType.TIMESTAMP)
	private Date bizDate;
	
	/**
	 * 业务结果
	 */
	@Column(name="RESULT",length=10)
	private String result;
	
	/**
	 * 异常信息
	 */
	@Column(name="EXCEPTION",length=200)
	private String exception;
	
	
	@Column(name="RECORD_VALUE")
	private String recordValue;
	
	@Override
	public boolean equals(Object obj) {
		if (obj == null)
			return false;
		if (obj instanceof BizLogInfo == false) {
			return false;
		}
		BizLogInfo bizValue = (BizLogInfo) obj;
		if (bizValue.getId() == this.getId())
			return true;
		return false;
	}

	@Override
	public int hashCode() {
		return HashCodeBuilder.reflectionHashCode(this);
	}

	@Override
	public String toString() {
		return "[BizLogInfo:]"+this.getId();
	}
	
/*
	public String getEntityId() {
		return entityId;
	}

	public void setEntityId(String entityId) {
		this.entityId = entityId;
	}
*/
	public String getOperator() {
		return operator;
	}

	public void setOperator(String operator) {
		this.operator = operator;
	}

	public String getBizType() {
		return bizType;
	}

	public void setBizType(String bizType) {
		this.bizType = bizType;
	}

	public String getBizOperation() {
		return bizOperation;
	}

	public void setBizOperation(String bizOperation) {
		this.bizOperation = bizOperation;
	}

	public Date getBizDate() {
		return bizDate;
	}

	public void setBizDate(Date bizDate) {
		this.bizDate = bizDate;
	}

	public String getResult() {
		return result;
	}

	public void setResult(String result) {
		this.result = result;
	}

	public String getException() {
		return exception;
	}

	public void setException(String exception) {
		this.exception = exception;
	}

	public String getSystem() {
		return system;
	}

	public void setSystem(String system) {
		this.system = system;
	}

	public String getServerIp() {
		return serverIp;
	}

	public void setServerIp(String serverIp) {
		this.serverIp = serverIp;
	}

	public String getClientIp() {
		return clientIp;
	}

	public void setClientIp(String clientIp) {
		this.clientIp = clientIp;
	}

	public String getRecordValue() {
		return recordValue;
	}

	public void setRecordValue(String recordValue) {
		this.recordValue = recordValue;
	}
	
}
